package sis.report;


import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import sis.studentinfo.Session;

public class CourseReport {

	private List<Session> sessions = new ArrayList<Session>();
	
	public void add(Session session) {
		this.sessions.add(session);
	}

	public String test() {
		Collections.sort(this.sessions);
		StringBuilder builder = new StringBuilder();
		for(Session session : this.sessions) {
			builder.append(
				String.format(session.getDepartment() + " " +
						session.getNumber() + "%n"));
		}
		return builder.toString();
	}
	
}
